package com.yyy.instagram.Adaper.ViewHolder;

import android.app.Activity;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;

import com.facebook.drawee.view.SimpleDraweeView;
import com.yyy.instagram.R;

public class GridTweetViewHolder extends RecyclerView.ViewHolder{
        public SimpleDraweeView imageLeft;
        public SimpleDraweeView imageCenter;
        public SimpleDraweeView imageRight;
        public GridTweetViewHolder(View itemView, Context context) {
            super(itemView);
            imageLeft = (SimpleDraweeView) itemView.findViewById(R.id.item_tweet_grid_left);
            imageCenter = (SimpleDraweeView) itemView.findViewById(R.id.item_tweet_grid_center);
            imageRight = (SimpleDraweeView) itemView.findViewById(R.id.item_tweet_grid_right);

            LinearLayout.LayoutParams leftParams = (LinearLayout.LayoutParams) imageLeft.getLayoutParams();
            LinearLayout.LayoutParams centerParams = (LinearLayout.LayoutParams) imageCenter.getLayoutParams();
            LinearLayout.LayoutParams rightParams = (LinearLayout.LayoutParams) imageRight.getLayoutParams();
            int srceenW = ((Activity)context).getWindowManager().getDefaultDisplay().getWidth();
            leftParams.height = srceenW/3-2;
            centerParams.height = srceenW/3-2;
            rightParams.height = srceenW/3-2;
            imageLeft.setLayoutParams(leftParams);
            imageCenter.setLayoutParams(centerParams);
            imageRight.setLayoutParams(rightParams);
        }
    }